package com.hs.jhzd.repository;

import com.hs.jhzd.entity.QuestionnaireAnswer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;


import java.util.Date;
import java.util.List;

public interface QuestionnaireAnswerRepository extends JpaRepository<QuestionnaireAnswer, String> {
    @Query("select  u from QuestionnaireAnswer u where (:rybh is null or u.prisonerNumber=:rybh)  and ( :jsbh is null or u.prisonId=:jsbh) and u.createTime between :startTime and :endTime ")
    List<QuestionnaireAnswer> findByRybhAndJsbhAndSjc(@Param("rybh") String rybh, @Param("jsbh")String jsbh,@Param("startTime") Date startTime, @Param("endTime")Date endTime);
}
